package exception.demo02;

/**
 * @author IT_Jay
 * @date 2022/1/27 20:06
 */

public class Test {


    static void test(int a) throws MyException {
        System.out.println("传递的参数为："+a);

        if (a>10){
            throw new MyException(a);       //抛出
        }
        System.out.println("OK");
    }

    public static void main(String[] args) {
        try {
            test(11);
        }catch (MyException e){
            System.out.println(e);
        }
    }

}
